home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / DJGPP / GCC257DC.ZIP / docs / gcc / gcc.i4 (.txt) < prev    next >
GNU Info File  |  1993-12-15  |  41KB  |  771 lines

  1. This is Info file gcc.info, produced by Makeinfo-1.54 from the input
  2. file gcc.texi.
  3.    This file documents the use and the internals of the GNU compiler.
  4.    Published by the Free Software Foundation 675 Massachusetts Avenue
  5. Cambridge, MA 02139 USA
  6.    Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
  7.    Permission is granted to make and distribute verbatim copies of this
  8. manual provided the copyright notice and this permission notice are
  9. preserved on all copies.
  10.    Permission is granted to copy and distribute modified versions of
  11. this manual under the conditions for verbatim copying, provided also
  12. that the sections entitled "GNU General Public License" and "Protect
  13. Your Freedom--Fight `Look And Feel'" are included exactly as in the
  14. original, and provided that the entire resulting derived work is
  15. distributed under the terms of a permission notice identical to this
  16.    Permission is granted to copy and distribute translations of this
  17. manual into another language, under the above conditions for modified
  18. versions, except that the sections entitled "GNU General Public
  19. License" and "Protect Your Freedom--Fight `Look And Feel'", and this
  20. permission notice, may be included in translations approved by the Free
  21. Software Foundation instead of in the original English.
  22. File: gcc.info,  Node: RS/6000 and PowerPC Options,  Next: RT Options,  Prev: M88K Options,  Up: Submodel Options
  23. IBM RS/6000 and PowerPC Options
  24. -------------------------------
  25.    These `-m' options are defined for the IBM RS/6000 and PowerPC:
  26. `-mpower'
  27. `-mno-power'
  28. `-mpower2'
  29. `-mno-power2'
  30. `-mpowerpc'
  31. `-mno-powerpc'
  32. `-mpowerpcsqr'
  33. `-mno-powerpcsqr'
  34. `-mpowerpc64'
  35. `-mno-powerpc64'
  36.      GNU CC supports two related instruction set architectures for the
  37.      RS/6000 and PowerPC.  The "POWER" instruction set are those
  38.      instructions supported by the `rios' chip set used in the original
  39.      RS/6000 systems and the "PowerPC" instruction set is the
  40.      architecture of the Motorola MPC6xx microprocessors.  The PowerPC
  41.      architecture defines 64-bit instructions, but they are not
  42.      supported by any current processors.
  43.      Neither architecture is a subset of the other.  However there is a
  44.      large common subset of instructions supported by both.  An MQ
  45.      register is included in processors supporting the POWER
  46.      architecture.
  47.      You use these options to specify which instructions are available
  48.      on the processor you are using.  The default value of these
  49.      options is determined when configuring GNU CC.  Specifying the
  50.      `-mcpu=CPU_TYPE' overrides the specification of these options.  We
  51.      recommend you use that option rather than these.
  52.      The `-mpower' option allows GNU CC to generate instructions that
  53.      are found only in the POWER architecture and to use the MQ
  54.      register.  Specifying `-mpower2' implies `-power' and also allows
  55.      GNU CC to generate instructions that are present in the POWER2
  56.      architecture but not the original POWER architecture.
  57.      The `-mpowerpc' option allows GNU CC to generate instructions that
  58.      are found only in the 32-bit subset of the PowerPC architecture.
  59.      Specifying `-mpowerpcsqr' implies `-mpowerpc' and also allows GNU
  60.      CC to use the floating point square root instructions in the
  61.      PowerPC architecture but not in its first implementation.
  62.      Likewise, specifying `-mpowerpc64' implies `-mpowerpc' and also
  63.      allows GNU CC to use the 64-bit instructions in the PowerPC
  64.      architecture.
  65.      If you specify both `-mno-power' and `-mno-powerpc', GNU CC will
  66.      use only the instructions in the common subset of both
  67.      architectures and will not use the MQ register.  Specifying both
  68.      `-mpower' and `-mpowerpc' permits GNU CC to use any instruction
  69.      from either architecture and to allow use of the MQ register;
  70.      specify this for the Motorola MPC601.
  71. `-mnew-mnemonics'
  72. `-mold-mnemonics'
  73.      Select which mnemonics to use in the generated assembler code.
  74.      `-mnew-mnemonics' requests output that uses the assembler mnemonics
  75.      defined for the PowerPC architecture, while `-mold-mnemonics'
  76.      requests the assembler mnemonics defined for the POWER
  77.      architecture.  Instructions defined in only one architecture have
  78.      only one mnemonic; GNU CC uses that mnemonic irrespective of which
  79.      of thse options is specified.
  80.      PowerPC assemblers support both the old and new mnemonics, as will
  81.      later POWER assemblers.  Current POWER assemblers only support the
  82.      old mnemonics.  Specify `-mnew-mnemonics' if you have an assembler
  83.      that supports them, otherwise specify `-mold-mnemonics'.
  84.      The default value of these options depends on how GNU CC was
  85.      configured.  Specifing `-mcpu=CPU_TYPE' sometimes overrides the
  86.      value of these option.  Unless you are building a cross-compiled,
  87.      you should normally not specify either `-mnew-mnemonics' or
  88.      `-mold-mnemonics', but should instead accept the default.
  89. `-mcpu=CPU_TYPE'
  90.      Set architecture type, register usage, choice of mnemonics, and
  91.      instruction scheduling parameters for machine type CPU_TYPE.  By
  92.      default, CPU_TYPE is the target system defined when GNU CC was
  93.      configured.  Supported values for CPU_TYPE are `rios1', `rios2',
  94.      `rsc1', `601', `603', `604', `620' and `all'.
  95.      Specifying `-mcpu=rios1' or `-mcpu=rios2' enables the `-mpower'
  96.      option and disables the `-mpowerpc' option, `-mcpu=601' enables
  97.      both the `-mpower' and `-mpowerpc' options, `-mcpu=603' and
  98.      `-mcpu=604' enable the `-mpowerpc' option and disables the
  99.      `-mpower' option, and `-mcpu=620' enables both the `-mpowerpc' and
  100.      `-mpowerpc64' options and also disables the `-mpower' option.
  101.      To generate code that will operate on all members of the RS/6000
  102.      and PowerPC family, specify `-mcpu=all'.  In that case, GNU CC will
  103.      only use instructions in the common subset and will not use the MQ
  104.      register.  The instruction scheduling parameters and choice of
  105.      mnemonics are not affected.
  106.      Specifying `-mcpu=601', `-mcpu=603', `-mcpu=604', or `-mcpu=620'
  107.      also enables the `new-mnemonics' option.
  108. `-mnormal-toc'
  109. `-mno-fp-in-toc'
  110. `-mminimal-toc'
  111.      Modify generation of the TOC (Table Of Contents), which is created
  112.      for every executable file.  The `-mnormal-toc' option is selected
  113.      by default.  In that case, GNU CC will allocate at least one TOC
  114.      entry for each unique non-automatic variable reference in your
  115.      program.  GNU CC will also place floating-point constants in the
  116.      TOC.  However, only 16K entries are available in the TOC.
  117.      If you receive a linker error message that says you have
  118.      overflowed the available TOC space, recompile your files with
  119.      either the `-mno-fp-in-toc' or `-mminimal-toc' options.
  120.      `-mno-fp-in-toc' prevents GNU CC from putting floating-point
  121.      constants in the TOC.  `-mminimal-toc' causes GNU CC to make only
  122.      one TOC entry for every file.  Using the `-minimal-toc' option
  123.      produces slightly slower and larger code than the `-mnormal-toc' or
  124.      `-mno-fp-in-toc' options.  If you use floating-point, try the
  125.      `-mno-fp-in-toc' option before you specify `-mminimal-toc'.
  126. File: gcc.info,  Node: RT Options,  Next: MIPS Options,  Prev: RS/6000 and PowerPC Options,  Up: Submodel Options
  127. IBM RT Options
  128. --------------
  129.    These `-m' options are defined for the IBM RT PC:
  130. `-min-line-mul'
  131.      Use an in-line code sequence for integer multiplies.  This is the
  132.      default.
  133. `-mcall-lib-mul'
  134.      Call `lmul$$' for integer multiples.
  135. `-mfull-fp-blocks'
  136.      Generate full-size floating point data blocks, including the
  137.      minimum amount of scratch space recommended by IBM.  This is the
  138.      default.
  139. `-mminimum-fp-blocks'
  140.      Do not include extra scratch space in floating point data blocks.
  141.      This results in smaller code, but slower execution, since scratch
  142.      space must be allocated dynamically.
  143. `-mfp-arg-in-fpregs'
  144.      Use a calling sequence incompatible with the IBM calling
  145.      convention in which floating point arguments are passed in
  146.      floating point registers.  Note that `varargs.h' and `stdargs.h'
  147.      will not work with floating point operands if this option is
  148.      specified.
  149. `-mfp-arg-in-gregs'
  150.      Use the normal calling convention for floating point arguments.
  151.      This is the default.
  152. `-mhc-struct-return'
  153.      Return structures of more than one word in memory, rather than in a
  154.      register.  This provides compatibility with the MetaWare HighC (hc)
  155.      compiler.  Use the option `-fpcc-struct-return' for compatibility
  156.      with the Portable C Compiler (pcc).
  157. `-mnohc-struct-return'
  158.      Return some structures of more than one word in registers, when
  159.      convenient.  This is the default.  For compatibility with the
  160.      IBM-supplied compilers, use the option `-fpcc-struct-return' or the
  161.      option `-mhc-struct-return'.
  162. File: gcc.info,  Node: MIPS Options,  Next: i386 Options,  Prev: RT Options,  Up: Submodel Options
  163. MIPS Options
  164. ------------
  165.    These `-m' options are defined for the MIPS family of computers:
  166. `-mcpu=CPU TYPE'
  167.      Assume the defaults for the machine type CPU TYPE when scheduling
  168.      instructions.  The default CPU TYPE is `default', which picks the
  169.      longest cycles times for any of the machines, in order that the
  170.      code run at reasonable rates on all MIPS cpu's.  Other choices for
  171.      CPU TYPE are `r2000', `r3000', `r4000', and `r6000'.  While
  172.      picking a specific CPU TYPE will schedule things appropriately for
  173.      that particular chip, the compiler will not generate any code that
  174.      does not meet level 1 of the MIPS ISA (instruction set
  175.      architecture) without the `-mips2' or `-mips3' switches being used.
  176. `-mips2'
  177.      Issue instructions from level 2 of the MIPS ISA (branch likely,
  178.      square root instructions).  The `-mcpu=r4000' or `-mcpu=r6000'
  179.      switch must be used in conjunction with `-mips2'.
  180. `-mips3'
  181.      Issue instructions from level 3 of the MIPS ISA (64 bit
  182.      instructions).  You must use the `-mcpu=r4000' switch along with
  183.      `-mips3'.
  184. `-mint64'
  185. `-mlong64'
  186. `-mlonglong128'
  187.      These options don't work at present.
  188. `-mmips-as'
  189.      Generate code for the MIPS assembler, and invoke `mips-tfile' to
  190.      add normal debug information.  This is the default for all
  191.      platforms except for the OSF/1 reference platform, using the
  192.      OSF/rose object format.  If the either of the `-gstabs' or
  193.      `-gstabs+' switches are used, the `mips-tfile' program will
  194.      encapsulate the stabs within MIPS ECOFF.
  195. `-mgas'
  196.      Generate code for the GNU assembler.  This is the default on the
  197.      OSF/1 reference platform, using the OSF/rose object format.
  198. `-mrnames'
  199. `-mno-rnames'
  200.      The `-mrnames' switch says to output code using the MIPS software
  201.      names for the registers, instead of the hardware names (ie, A0
  202.      instead of $4).  The GNU assembler does not support the `-mrnames'
  203.      switch, and the MIPS assembler will be instructed to run the MIPS
  204.      C preprocessor over the source file.  The `-mno-rnames' switch is
  205.      default.
  206. `-mgpopt'
  207. `-mno-gpopt'
  208.      The `-mgpopt' switch says to write all of the data declarations
  209.      before the instructions in the text section, this allows the MIPS
  210.      assembler to generate one word memory references instead of using
  211.      two words for short global or static data items.  This is on by
  212.      default if optimization is selected.
  213. `-mstats'
  214. `-mno-stats'
  215.      For each non-inline function processed, the `-mstats' switch
  216.      causes the compiler to emit one line to the standard error file to
  217.      print statistics about the program (number of registers saved,
  218.      stack size, etc.).
  219. `-mmemcpy'
  220. `-mno-memcpy'
  221.      The `-mmemcpy' switch makes all block moves call the appropriate
  222.      string function (`memcpy' or `bcopy') instead of possibly
  223.      generating inline code.
  224. `-mmips-tfile'
  225. `-mno-mips-tfile'
  226.      The `-mno-mips-tfile' switch causes the compiler not postprocess
  227.      the object file with the `mips-tfile' program, after the MIPS
  228.      assembler has generated it to add debug support.  If `mips-tfile'
  229.      is not run, then no local variables will be available to the
  230.      debugger.  In addition, `stage2' and `stage3' objects will have
  231.      the temporary file names passed to the assembler embedded in the
  232.      object file, which means the objects will not compare the same.
  233.      The `-mno-mips-tfile' switch should only be used when there are
  234.      bugs in the `mips-tfile' program that prevents compilation.
  235. `-msoft-float'
  236.      Generate output containing library calls for floating point.
  237.      *Warning:* the requisite libraries are not part of GNU CC.
  238.      Normally the facilities of the machine's usual C compiler are
  239.      used, but this can't be done directly in cross-compilation.  You
  240.      must make your own arrangements to provide suitable library
  241.      functions for cross-compilation.
  242. `-mhard-float'
  243.      Generate output containing floating point instructions.  This is
  244.      the default if you use the unmodified sources.
  245. `-mfp64'
  246.      Assume that the FR bit in the status word is on, and that there
  247.      are 32 64-bit floating point registers, instead of 32 32-bit
  248.      floating point registers.  You must also specify the `-mcpu=r4000'
  249.      and `-mips3' switches.
  250. `-mfp32'
  251.      Assume that there are 32 32-bit floating point registers.  This is
  252.      the default.
  253. `-mabicalls'
  254. `-mno-abicalls'
  255.      Emit (or do not emit) the pseudo operations `.abicalls',
  256.      `.cpload', and `.cprestore' that some System V.4 ports use for
  257.      position independent code.
  258. `-mlong-calls'
  259. `-mlong-calls'
  260.      Do all calls with the `JALR' instruction, which requires loading
  261.      up a function's address into a register before the call.  You need
  262.      to use this switch, if you call outside of the current 512
  263.      megabyte segment to functions that are not through pointers.
  264. `-mhalf-pic'
  265. `-mno-half-pic'
  266.      Put pointers to extern references into the data section and load
  267.      them up, rather than put the references in the text section.
  268. `-G NUM'
  269.      Put global and static items less than or equal to NUM bytes into
  270.      the small data or bss sections instead of the normal data or bss
  271.      section.  This allows the assembler to emit one word memory
  272.      reference instructions based on the global pointer (GP or $28),
  273.      instead of the normal two words used.  By default, NUM is 8 when
  274.      the MIPS assembler is used, and 0 when the GNU assembler is used.
  275.      The `-G NUM' switch is also passed to the assembler and linker.
  276.      All modules should be compiled with the same `-G NUM' value.
  277. `-nocpp'
  278.      Tell the MIPS assembler to not run it's preprocessor over user
  279.      assembler files (with a `.s' suffix) when assembling them.
  280.    These options are defined by the macro `TARGET_SWITCHES' in the
  281. machine description.  The default for the options is also defined by
  282. that macro, which enables you to change the defaults.
  283. File: gcc.info,  Node: i386 Options,  Next: HPPA Options,  Prev: MIPS Options,  Up: Submodel Options
  284. Intel 386 Options
  285. -----------------
  286.    These `-m' options are defined for the i386 family of computers:
  287. `-m486'
  288. `-mno-486'
  289.      Control whether or not code is optimized for a 486 instead of an
  290.      386.  Code generated for an 486 will run on a 386 and vice versa.
  291. `-msoft-float'
  292.      Generate output containing library calls for floating point.
  293.      *Warning:* the requisite libraries are not part of GNU CC.
  294.      Normally the facilities of the machine's usual C compiler are
  295.      used, but this can't be done directly in cross-compilation.  You
  296.      must make your own arrangements to provide suitable library
  297.      functions for cross-compilation.
  298.      On machines where a function returns floating point results in the
  299.      80387 register stack, some floating point opcodes may be emitted
  300.      even if `-msoft-float' is used.
  301. `-mno-fp-ret-in-387'
  302.      Do not use the FPU registers for return values of functions.
  303.      The usual calling convention has functions return values of types
  304.      `float' and `double' in an FPU register, even if there is no FPU.
  305.      The idea is that the operating system should emulate an FPU.
  306.      The option `-mno-fp-ret-in-387' causes such values to be returned
  307.      in ordinary CPU registers instead.
  308. File: gcc.info,  Node: HPPA Options,  Next: Intel 960 Options,  Prev: i386 Options,  Up: Submodel Options
  309. HPPA Options
  310. ------------
  311.    These `-m' options are defined for the HPPA family of computers:
  312. `-mpa-risc-1-0'
  313.      Generate code for a PA 1.0 processor.
  314. `-mpa-risc-1-1'
  315.      Generate code for a PA 1.1 processor.
  316. `-mlong-calls'
  317.      Generate code which allows calls to functions greater than 256k
  318.      away from the caller when the caller and callee are in the same
  319.      source file.  Do not turn this option on unless code refuses to
  320.      link with "branch out of range errors" from the linker.
  321. `-mdisable-fpregs'
  322.      Prevent floating point registers from being used in any manner.
  323.      This is necessary for compiling kernels which perform lazy context
  324.      switching of floating point registers.  If you use this option and
  325.      attempt to perform floating point operations, the compiler will
  326.      abort.
  327. `-mdisable-indexing'
  328.      Prevent the compiler from using indexing address modes.  This
  329.      avoids some rather obscure problems when compiling MIG generated
  330.      code under MACH.
  331. `-mtrailing-colon'
  332.      Add a colon to the end of label definitions (for ELF assemblers).
  333. File: gcc.info,  Node: Intel 960 Options,  Next: DEC Alpha Options,  Prev: HPPA Options,  Up: Submodel Options
  334. Intel 960 Options
  335. -----------------
  336.    These `-m' options are defined for the Intel 960 implementations:
  337. `-mCPU TYPE'
  338.      Assume the defaults for the machine type CPU TYPE for some of the
  339.      other options, including instruction scheduling, floating point
  340.      support, and addressing modes.  The choices for CPU TYPE are `ka',
  341.      `kb', `mc', `ca', `cf', `sa', and `sb'.  The default is `kb'.
  342. `-mnumerics'
  343. `-msoft-float'
  344.      The `-mnumerics' option indicates that the processor does support
  345.      floating-point instructions.  The `-msoft-float' option indicates
  346.      that floating-point support should not be assumed.
  347. `-mleaf-procedures'
  348. `-mno-leaf-procedures'
  349.      Do (or do not) attempt to alter leaf procedures to be callable
  350.      with the `bal' instruction as well as `call'.  This will result in
  351.      more efficient code for explicit calls when the `bal' instruction
  352.      can be substituted by the assembler or linker, but less efficient
  353.      code in other cases, such as calls via function pointers, or using
  354.      a linker that doesn't support this optimization.
  355. `-mtail-call'
  356. `-mno-tail-call'
  357.      Do (or do not) make additional attempts (beyond those of the
  358.      machine-independent portions of the compiler) to optimize
  359.      tail-recursive calls into branches.  You may not want to do this
  360.      because the detection of cases where this is not valid is not
  361.      totally complete.  The default is `-mno-tail-call'.
  362. `-mcomplex-addr'
  363. `-mno-complex-addr'
  364.      Assume (or do not assume) that the use of a complex addressing
  365.      mode is a win on this implementation of the i960.  Complex
  366.      addressing modes may not be worthwhile on the K-series, but they
  367.      definitely are on the C-series.  The default is currently
  368.      `-mcomplex-addr' for all processors except the CB and CC.
  369. `-mcode-align'
  370. `-mno-code-align'
  371.      Align code to 8-byte boundaries for faster fetching (or don't
  372.      bother).  Currently turned on by default for C-series
  373.      implementations only.
  374. `-mic-compat'
  375. `-mic2.0-compat'
  376. `-mic3.0-compat'
  377.      Enable compatibility with iC960 v2.0 or v3.0.
  378. `-masm-compat'
  379. `-mintel-asm'
  380.      Enable compatibility with the iC960 assembler.
  381. `-mstrict-align'
  382. `-mno-strict-align'
  383.      Do not permit (do permit) unaligned accesses.
  384. `-mold-align'
  385.      Enable structure-alignment compatibility with Intel's gcc release
  386.      version 1.3 (based on gcc 1.37).  Currently this is buggy in that
  387.      `#pragma align 1' is always assumed as well, and cannot be turned
  388.      off.
  389. File: gcc.info,  Node: DEC Alpha Options,  Next: Clipper Options,  Prev: Intel 960 Options,  Up: Submodel Options
  390. DEC Alpha Options
  391. -----------------
  392.    These `-m' options are defined for the DEC Alpha implementations:
  393. `-mno-soft-float'
  394. `-msoft-float'
  395.      Use (do not use) the hardware floating-point instructions for
  396.      floating-point operations.  When `-msoft-float' is specified,
  397.      functions in `libgcc1.c' will be used to perform floating-point
  398.      operations.  Unless they are replaced by routines that emulate the
  399.      floating-point operations, or compiled in such a way as to call
  400.      such emulations routines, these routines will issue floating-point
  401.      operations.   If you are compiling for an Alpha without
  402.      floating-point operations, you must ensure that the library is
  403.      built so as not to call them.
  404.      Note that Alpha implementations without floating-point operations
  405.      are required to have floating-point registers.
  406. `-mfp-reg'
  407. `-mno-fp-regs'
  408.      Generate code that uses (does not use) the floating-point register
  409.      set.  `-mno-fp-regs' implies `-msoft-float'.  If the floating-point
  410.      register set is not used, floating point operands are passed in
  411.      integer registers as if they were integers and floating-point
  412.      results are passed in $0 instead of $f0.  This is a non-standard
  413.      calling sequence, so any function with a floating-point argument
  414.      or return value called by code compiled with `-mno-fp-regs' must
  415.      also be compiled with that option.
  416.      A typical use of this option is building a kernel that does not
  417.      use, and hence need not save and restore, any floating-point
  418.      registers.
  419. File: gcc.info,  Node: Clipper Options,  Next: System V Options,  Prev: DEC Alpha Options,  Up: Submodel Options
  420. Clipper Options
  421. ---------------
  422.    These `-m' options are defined for the Clipper implementations:
  423. `-mc300'
  424.      Produce code for a C300 Clipper processor. This is the default.
  425. `-mc400'
  426.      Produce code for a C400 Clipper processor i.e. use floting point
  427.      registers f8..f15.
  428. File: gcc.info,  Node: System V Options,  Prev: Clipper Options,  Up: Submodel Options
  429. Options for System V
  430. --------------------
  431.    These additional options are available on System V Release 4 for
  432. compatibility with other compilers on those systems:
  433. `-Qy'
  434.      Identify the versions of each tool used by the compiler, in a
  435.      `.ident' assembler directive in the output.
  436. `-Qn'
  437.      Refrain from adding `.ident' directives to the output file (this is
  438.      the default).
  439. `-YP,DIRS'
  440.      Search the directories DIRS, and no others, for libraries
  441.      specified with `-l'.
  442. `-Ym,DIR'
  443.      Look in the directory DIR to find the M4 preprocessor.  The
  444.      assembler uses this option.
  445. File: gcc.info,  Node: Code Gen Options,  Next: Environment Variables,  Prev: Submodel Options,  Up: Invoking GCC
  446. Options for Code Generation Conventions
  447. =======================================
  448.    These machine-independent options control the interface conventions
  449. used in code generation.
  450.    Most of them have both positive and negative forms; the negative form
  451. of `-ffoo' would be `-fno-foo'.  In the table below, only one of the
  452. forms is listed--the one which is not the default.  You can figure out
  453. the other form by either removing `no-' or adding it.
  454. `-fpcc-struct-return'
  455.      Return "short" `struct' and `union' values in memory like longer
  456.      ones, rather than in registers.  This convention is less
  457.      efficient, but it has the advantage of allowing intercallability
  458.      between GNU CC-compiled files and files compiled with other
  459.      compilers.
  460.      The precise convention for returning structures in memory depends
  461.      on the target configuration macros.
  462.      Short structures and unions are those whose size and alignment
  463.      match that of some integer type.
  464. `-freg-struct-return'
  465.      Use the convention that `struct' and `union' values are returned
  466.      in registers when possible.  This is more efficient for small
  467.      structures than `-fpcc-struct-return'.
  468.      If you specify neither `-fpcc-struct-return' nor its contrary
  469.      `-freg-struct-return', GNU CC defaults to whichever convention is
  470.      standard for the target.  If there is no standard convention, GNU
  471.      CC defaults to `-fpcc-struct-return', except on targets where GNU
  472.      CC is the principal compiler.  In those cases, we can choose the
  473.      standard, and we chose the more efficient register return
  474.      alternative.
  475. `-fshort-enums'
  476.      Allocate to an `enum' type only as many bytes as it needs for the
  477.      declared range of possible values.  Specifically, the `enum' type
  478.      will be equivalent to the smallest integer type which has enough
  479.      room.
  480. `-fshort-double'
  481.      Use the same size for `double' as for `float'.
  482. `-fshared-data'
  483.      Requests that the data and non-`const' variables of this
  484.      compilation be shared data rather than private data.  The
  485.      distinction makes sense only on certain operating systems, where
  486.      shared data is shared between processes running the same program,
  487.      while private data exists in one copy per process.
  488. `-fno-common'
  489.      Allocate even uninitialized global variables in the bss section of
  490.      the object file, rather than generating them as common blocks.
  491.      This has the effect that if the same variable is declared (without
  492.      `extern') in two different compilations, you will get an error
  493.      when you link them.  The only reason this might be useful is if
  494.      you wish to verify that the program will work on other systems
  495.      which always work this way.
  496. `-fno-ident'
  497.      Ignore the `#ident' directive.
  498. `-fno-gnu-linker'
  499.      Do not output global initializations (such as C++ constructors and
  500.      destructors) in the form used by the GNU linker (on systems where
  501.      the GNU linker is the standard method of handling them).  Use this
  502.      option when you want to use a non-GNU linker, which also requires
  503.      using the `collect2' program to make sure the system linker
  504.      includes constructors and destructors.  (`collect2' is included in
  505.      the GNU CC distribution.)  For systems which *must* use
  506.      `collect2', the compiler driver `gcc' is configured to do this
  507.      automatically.
  508. `-finhibit-size-directive'
  509.      Don't output a `.size' assembler directive, or anything else that
  510.      would cause trouble if the function is split in the middle, and the
  511.      two halves are placed at locations far apart in memory.  This
  512.      option is used when compiling `crtstuff.c'; you should not need to
  513.      use it for anything else.
  514. `-fverbose-asm'
  515.      Put extra commentary information in the generated assembly code to
  516.      make it more readable.  This option is generally only of use to
  517.      those who actually need to read the generated assembly code
  518.      (perhaps while debugging the compiler itself).
  519. `-fvolatile'
  520.      Consider all memory references through pointers to be volatile.
  521. `-fvolatile-global'
  522.      Consider all memory references to extern and global data items to
  523.      be volatile.
  524. `-fpic'
  525.      Generate position-independent code (PIC) suitable for use in a
  526.      shared library, if supported for the target machine.  Such code
  527.      accesses all constant addresses through a global offset table
  528.      (GOT).  If the GOT size for the linked executable exceeds a
  529.      machine-specific maximum size, you get an error message from the
  530.      linker indicating that `-fpic' does not work; in that case,
  531.      recompile with `-fPIC' instead.  (These maximums are 16k on the
  532.      m88k, 8k on the Sparc, and 32k on the m68k and RS/6000.  The 386
  533.      has no such limit.)
  534.      Position-independent code requires special support, and therefore
  535.      works only on certain machines.  For the 386, GNU CC supports PIC
  536.      for System V but not for the Sun 386i.  Code generated for the IBM
  537.      RS/6000 is always position-independent.
  538.      The GNU assembler does not fully support PIC.  Currently, you must
  539.      use some other assembler in order for PIC to work.  We would
  540.      welcome volunteers to upgrade GAS to handle this; the first part
  541.      of the job is to figure out what the assembler must do differently.
  542. `-fPIC'
  543.      If supported for the target machine, emit position-independent
  544.      code, suitable for dynamic linking and avoiding any limit on the
  545.      size of the global offset table.  This option makes a difference
  546.      on the m68k, m88k and the Sparc.
  547.      Position-independent code requires special support, and therefore
  548.      works only on certain machines.
  549. `-ffixed-REG'
  550.      Treat the register named REG as a fixed register; generated code
  551.      should never refer to it (except perhaps as a stack pointer, frame
  552.      pointer or in some other fixed role).
  553.      REG must be the name of a register.  The register names accepted
  554.      are machine-specific and are defined in the `REGISTER_NAMES' macro
  555.      in the machine description macro file.
  556.      This flag does not have a negative form, because it specifies a
  557.      three-way choice.
  558. `-fcall-used-REG'
  559.      Treat the register named REG as an allocatable register that is
  560.      clobbered by function calls.  It may be allocated for temporaries
  561.      or variables that do not live across a call.  Functions compiled
  562.      this way will not save and restore the register REG.
  563.      Use of this flag for a register that has a fixed pervasive role in
  564.      the machine's execution model, such as the stack pointer or frame
  565.      pointer, will produce disastrous results.
  566.      This flag does not have a negative form, because it specifies a
  567.      three-way choice.
  568. `-fcall-saved-REG'
  569.      Treat the register named REG as an allocatable register saved by
  570.      functions.  It may be allocated even for temporaries or variables
  571.      that live across a call.  Functions compiled this way will save
  572.      and restore the register REG if they use it.
  573.      Use of this flag for a register that has a fixed pervasive role in
  574.      the machine's execution model, such as the stack pointer or frame
  575.      pointer, will produce disastrous results.
  576.      A different sort of disaster will result from the use of this flag
  577.      for a register in which function values may be returned.
  578.      This flag does not have a negative form, because it specifies a
  579.      three-way choice.
  580. `+e0'
  581. `+e1'
  582.      Control whether virtual function definitions in classes are used to
  583.      generate code, or only to define interfaces for their callers.
  584.      (C++ only).
  585.      These options are provided for compatibility with `cfront' 1.x
  586.      usage; the recommended alternative GNU C++ usage is in flux.
  587.      *Note Declarations and Definitions in One Header: C++ Interface.
  588.      With `+e0', virtual function definitions in classes are declared
  589.      `extern'; the declaration is used only as an interface
  590.      specification, not to generate code for the virtual functions (in
  591.      this compilation).
  592.      With `+e1', G++ actually generates the code implementing virtual
  593.      functions defined in the code, and makes them publicly visible.
  594. File: gcc.info,  Node: Environment Variables,  Next: Running Protoize,  Prev: Code Gen Options,  Up: Invoking GCC
  595. Environment Variables Affecting GNU CC
  596. ======================================
  597.    This section describes several environment variables that affect how
  598. GNU CC operates.  They work by specifying directories or prefixes to use
  599. when searching for various kinds of files.
  600.    Note that you can also specify places to search using options such as
  601. `-B', `-I' and `-L' (*note Directory Options::.).  These take
  602. precedence over places specified using environment variables, which in
  603. turn take precedence over those specified by the configuration of GNU
  604. CC.  *Note Driver::.
  605. `TMPDIR'
  606.      If `TMPDIR' is set, it specifies the directory to use for temporary
  607.      files.  GNU CC uses temporary files to hold the output of one
  608.      stage of compilation which is to be used as input to the next
  609.      stage: for example, the output of the preprocessor, which is the
  610.      input to the compiler proper.
  611. `GCC_EXEC_PREFIX'
  612.      If `GCC_EXEC_PREFIX' is set, it specifies a prefix to use in the
  613.      names of the subprograms executed by the compiler.  No slash is
  614.      added when this prefix is combined with the name of a subprogram,
  615.      but you can specify a prefix that ends with a slash if you wish.
  616.      If GNU CC cannot find the subprogram using the specified prefix, it
  617.      tries looking in the usual places for the subprogram.
  618.      Other prefixes specified with `-B' take precedence over this
  619.      prefix.
  620.      This prefix is also used for finding files such as `crt0.o' that
  621.      are used for linking.
  622.      In addition, the prefix is used in an unusual way in finding the
  623.      directories to search for header files.  For each of the standard
  624.      directories whose name normally begins with
  625.      `/usr/local/lib/gcc-lib' (more precisely, with the value of
  626.      `GCC_INCLUDE_DIR'), GNU CC tries replacing that beginning with the
  627.      specified prefix to produce an alternate directory name.  Thus,
  628.      with `-Bfoo/', GNU CC will search `foo/bar' where it would
  629.      normally search `/usr/local/lib/bar'.  These alternate directories
  630.      are searched first; the standard directories come next.
  631. `COMPILER_PATH'
  632.      The value of `COMPILER_PATH' is a colon-separated list of
  633.      directories, much like `PATH'.  GNU CC tries the directories thus
  634.      specified when searching for subprograms, if it can't find the
  635.      subprograms using `GCC_EXEC_PREFIX'.
  636. `LIBRARY_PATH'
  637.      The value of `LIBRARY_PATH' is a colon-separated list of
  638.      directories, much like `PATH'.  GNU CC tries the directories thus
  639.      specified when searching for special linker files, if it can't
  640.      find them using `GCC_EXEC_PREFIX'.  Linking using GNU CC also uses
  641.      these directories when searching for ordinary libraries for the
  642.      `-l' option (but directories specified with `-L' come first).
  643. `C_INCLUDE_PATH'
  644. `CPLUS_INCLUDE_PATH'
  645. `OBJC_INCLUDE_PATH'
  646.      These environment variables pertain to particular languages.  Each
  647.      variable's value is a colon-separated list of directories, much
  648.      like `PATH'.  When GNU CC searches for header files, it tries the
  649.      directories listed in the variable for the language you are using,
  650.      after the directories specified with `-I' but before the standard
  651.      header file directories.
  652. `DEPENDENCIES_OUTPUT'
  653.      If this variable is set, its value specifies how to output
  654.      dependencies for Make based on the header files processed by the
  655.      compiler.  This output looks much like the output from the `-M'
  656.      option (*note Preprocessor Options::.), but it goes to a separate
  657.      file, and is in addition to the usual results of compilation.
  658.      The value of `DEPENDENCIES_OUTPUT' can be just a file name, in
  659.      which case the Make rules are written to that file, guessing the
  660.      target name from the source file name.  Or the value can have the
  661.      form `FILE TARGET', in which case the rules are written to file
  662.      FILE using TARGET as the target name.
  663. File: gcc.info,  Node: Running Protoize,  Prev: Environment Variables,  Up: Invoking GCC
  664. Running Protoize
  665. ================
  666.    The program `protoize' is an optional part of GNU C.  You can use it
  667. to add prototypes to a program, thus converting the program to ANSI C
  668. in one respect.  The companion program `unprotoize' does the reverse:
  669. it removes argument types from any prototypes that are found.
  670.    When you run these programs, you must specify a set of source files
  671. as command line arguments.  The conversion programs start out by
  672. compiling these files to see what functions they define.  The
  673. information gathered about a file FOO is saved in a file named `FOO.X'.
  674.    After scanning comes actual conversion.  The specified files are all
  675. eligible to be converted; any files they include (whether sources or
  676. just headers) are eligible as well.
  677.    But not all the eligible files are converted.  By default,
  678. `protoize' and `unprotoize' convert only source and header files in the
  679. current directory.  You can specify additional directories whose files
  680. should be converted with the `-d DIRECTORY' option.  You can also
  681. specify particular files to exclude with the `-x FILE' option.  A file
  682. is converted if it is eligible, its directory name matches one of the
  683. specified directory names, and its name within the directory has not
  684. been excluded.
  685.    Basic conversion with `protoize' consists of rewriting most function
  686. definitions and function declarations to specify the types of the
  687. arguments.  The only ones not rewritten are those for varargs functions.
  688.    `protoize' optionally inserts prototype declarations at the
  689. beginning of the source file, to make them available for any calls that
  690. precede the function's definition.  Or it can insert prototype
  691. declarations with block scope in the blocks where undeclared functions
  692. are called.
  693.    Basic conversion with `unprotoize' consists of rewriting most
  694. function declarations to remove any argument types, and rewriting
  695. function definitions to the old-style pre-ANSI form.
  696.    Both conversion programs print a warning for any function
  697. declaration or definition that they can't convert.  You can suppress
  698. these warnings with `-q'.
  699.    The output from `protoize' or `unprotoize' replaces the original
  700. source file.  The original file is renamed to a name ending with
  701. `.save'.  If the `.save' file already exists, then the source file is
  702. simply discarded.
  703.    `protoize' and `unprotoize' both depend on GNU CC itself to scan the
  704. program and collect information about the functions it uses.  So
  705. neither of these programs will work until GNU CC is installed.
  706.    Here is a table of the options you can use with `protoize' and
  707. `unprotoize'.  Each option works with both programs unless otherwise
  708. stated.
  709. `-B DIRECTORY'
  710.      Look for the file `SYSCALLS.c.X' in DIRECTORY, instead of the
  711.      usual directory (normally `/usr/local/lib').  This file contains
  712.      prototype information about standard system functions.  This option
  713.      applies only to `protoize'.
  714. `-c COMPILATION-OPTIONS'
  715.      Use  COMPILATION-OPTIONS as the options when running `gcc' to
  716.      produce the `.X' files.  The special option `-aux-info' is always
  717.      passed in addition, to tell `gcc' to write a `.X' file.
  718.      Note that the compilation options must be given as a single
  719.      argument to `protoize' or `unprotoize'.  If you want to specify
  720.      several `gcc' options, you must quote the entire set of
  721.      compilation options to make them a single word in the shell.
  722.      There are certain `gcc' arguments that you cannot use, because they
  723.      would produce the wrong kind of output.  These include `-g', `-O',
  724.      `-c', `-S', and `-o' If you include these in the
  725.      COMPILATION-OPTIONS, they are ignored.
  726.      Rename files to end in `.C' instead of `.c'.  This is convenient
  727.      if you are converting a C program to C++.  This option applies
  728.      only to `protoize'.
  729.      Add explicit global declarations.  This means inserting explicit
  730.      declarations at the beginning of each source file for each function
  731.      that is called in the file and was not declared.  These
  732.      declarations precede the first function definition that contains a
  733.      call to an undeclared function.  This option applies only to
  734.      `protoize'.
  735. `-i STRING'
  736.      Indent old-style parameter declarations with the string STRING.
  737.      This option applies only to `protoize'.
  738.      `unprotoize' converts prototyped function definitions to old-style
  739.      function definitions, where the arguments are declared between the
  740.      argument list and the initial `{'.  By default, `unprotoize' uses
  741.      five spaces as the indentation.  If you want to indent with just
  742.      one space instead, use `-i " "'.
  743.      Keep the `.X' files.  Normally, they are deleted after conversion
  744.      is finished.
  745.      Add explicit local declarations.  `protoize' with `-l' inserts a
  746.      prototype declaration for each function in each block which calls
  747.      the function without any declaration.  This option applies only to
  748.      `protoize'.
  749.      Make no real changes.  This mode just prints information about the
  750.      conversions that would have been done without `-n'.
  751.      Make no `.save' files.  The original files are simply deleted.
  752.      Use this option with caution.
  753. `-p PROGRAM'
  754.      Use the program PROGRAM as the compiler.  Normally, the name `gcc'
  755.      is used.
  756.      Work quietly.  Most warnings are suppressed.
  757.      Print the version number, just like `-v' for `gcc'.
  758.    If you need special compiler options to compile one of your program's
  759. source files, then you should generate that file's `.X' file specially,
  760. by running `gcc' on that source file with the appropriate options and
  761. the option `-aux-info'.  Then run `protoize' on the entire set of
  762. files.  `protoize' will use the existing `.X' file because it is newer
  763. than the source file.  For example:
  764.      gcc -Dfoo=bar file1.c -aux-info
  765.      protoize *.c
  766. You need to include the special files along with the rest in the
  767. `protoize' command, even though their `.X' files already exist, because
  768. otherwise they won't get converted.
  769.    *Note Protoize Caveats::, for more information on how to use
  770. `protoize' successfully.
  771.